import java.util.Arrays;
import java.util.Objects;
import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-03-06
 * Time: 12:38
 */

interface Pug{
    void test();

    public static void test1(){};

    public static void test2(){};
}
class Sum{
    void test(){};
}

class Person implements Comparable<Person>{
    public String name;
    public int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public int compareTo(Person o) {
        return this.age - o.age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
public class Test {

    public static void main(String[] args) {
        String str = "abcd";
        StringBuilder stringBuilder = new StringBuilder(str);
        for (int i = 0; i < 10; i++) {
            stringBuilder.append(i);
        }
        stringBuilder.reverse();
        stringBuilder.replace(0,5,"987");
        str = stringBuilder.toString();
        System.out.println(str);
    }
    public static void main6(String[] args) {
        Person[] person1 = new Person[3];
        person1[1] = new Person("张三",14);
        person1[0] = new Person("李四",34);
        person1[2] = new Person("王五",24);

        Arrays.sort(person1);
        System.out.println(Arrays.toString(person1));
        Comparable[] arr = new Comparable[3];
    }
    public static void main5(String[] args) {
        String str = "dfsdsdf";
        for (int i = 0; i < str.length(); i++) {
            char a = str.charAt(i);
        }
    }
    public static float max(float x,float y,float z){
        if (x > y){
            if (x > z){
                return x;
            }
            return z;
        }else {
            if (y > z){
                return y;
            }
            return z;
        }
    }
    public static int max(int x,int y){
        return x > y ? x : y;
    }
    public static void main3(String[] args) {
        float x = 0.0f;
        float y = 1.2f;
        float z = 3.6f;
        int i = 21;
        int j = 1;
        System.out.println(max(i,j));
        System.out.println(max(x,y,z));
    }
    public static int sum(int x,int y){
        return x + y;
    }
    public static int sum(int x,int y, int z){
        return x + y + z;
    }
    public static void main2(String[] args) {
        int x = 2;
        int y = 3;
        int z = 9;
        int ret1 = sum(x,y);
        int ret2 = sum(x,y,z);
        System.out.println(ret1);
        System.out.println(ret2);
    }

    public static int fib(int n){
        int a = 1;
        int b = 1;
        int c = 1;
        while (n > 2){
            c = a + b;
            a = b;
            b = c;
            n--;
        }
        return c;
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ret = fib(n);
        System.out.println(ret);
    }
}
